package day_2022_12_to_3.year2023;

import java.util.HashMap;
import java.util.Map;

/**
 * @author haomin
 * @date 2023/03/26 08:51
 **/
public class Day3_26_Num2395 {
    class Solution {
        public boolean findSubarrays(int[] nums) {
            if(nums.length <= 2) return false;
            Map<Integer, Integer> map = new HashMap<>();
            for(int i = 1; i < nums.length; ++i) {
                int sum = nums[i] + nums[i-1];
                if(map.containsKey(sum)) {
                    if(map.get(sum) != i-1) return true;
                }else map.put(sum, i-1);
            }
            return false;
        }
    }
}